#pragma once

#include "tick.h"

class CTickThreadProcesser
{
public:
	virtual intptr_t Process() = 0;
};

class CTickThread
{
public:
	CTickThread();
	~CTickThread();
	void Start(const TICK &target, CTickThreadProcesser *proc);
	void Stop(bool wait);
	void tickThread();
	__forceinline intptr_t getResult() const { return procResult; }

	bool threadRunning;
protected:
	TICK targetTick;
	HANDLE hThread, hEvent;
	CTickThreadProcesser *processer;
	intptr_t procResult;
};
